#include <iostream>
#include <cassert>
#include <vector>
#include <algorithm>
#include <sstream>
#include <list>
#include <stack>
#include <queue>
#include <map>
using namespace std;



#define STEP(bitShift)\
if((0x40000000l >> bitShift) + sqrtVal <= val)\
{ \
    val -= (0x40000000l >> bitShift) + sqrtVal;\
    sqrtVal = (sqrtVal >> 1) | (0x40000000l >> bitShift);\
} \
else \
{ \
    sqrtVal = sqrtVal >> 1;\
} 


/******************************************************************************
*
* Function Name:   FixedSqrt
* Description:     Calculate the square root.
* Parameters:      int val: input
* Return value:    int: square root value.
*
*****************************************************************************/
int FixedSqrt(int val)
{
    int sqrtVal = 0;

    STEP(0);
    STEP(2);
    STEP(4);
    STEP(6);
    STEP(8);
    STEP(10);
    STEP(12);
    STEP(14);
    STEP(16);
    STEP(18);
    STEP(20);
    STEP(22);
    STEP(24);
    STEP(26);
    STEP(28);
    STEP(30);

    if (sqrtVal < val)
    {
        ++sqrtVal;
    }

    return sqrtVal;
}


int main(){
    cout<< FixedSqrt(26)<<endl;
    return 0;
}